package com.unlcn.ils.crsc.service.crsc.impl;

import com.unlcn.ils.crsc.dao.mapper.crsc.CrscOtdLogMapper;
import com.unlcn.ils.crsc.dao.model.crsc.CrscOtdLog;
import com.unlcn.ils.crsc.service.crsc.CrscOTDLogService;
import com.unlcn.ils.crsc.service.util.BaseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CrscOTDLogServiceImpl implements CrscOTDLogService{

    private static final Logger logger = LoggerFactory.getLogger(CrscOTDLogServiceImpl.class);

    @Autowired
    private CrscOtdLogMapper crscOtdLogMapper;

    @Override
    public int insert(CrscOtdLog crscOtdLog) throws BaseException {
        int intRtn;

        try{
            intRtn = crscOtdLogMapper.insert(crscOtdLog);
        }
        catch (Exception ex){
            logger.error(ex.getMessage());
            throw new BaseException(ex.getMessage());
        }

        return intRtn;
    }
}
